<?php  if($category_id==CORE_CATEGORY_HOSTING_REVIEW) $this->featuredHosting(); ?>
<article id="mainContain" class="wrapper">
	<section class="floatLeft" id="lastestPost">
		<div id="newItem-1" class="lastItems catHead">
			<h1># <?php single_cat_title(); ?></h1>
			<p>Có tất cả <?php echo $postCount; ?> bài viết trong chuyên mục # <?php single_cat_title(); ?>, nếu bạn không tìm thấy bài viết mình cần có thể <a href="https://www.izwebz.com/giai-dap-thac-mac/" class="bold">gửi thư yêu cầu</a> cho chúng tôi. Chúng tôi sẽ nghiên cứu và viết bài mới theo yêu cầu của bạn.</p>
		</div>
		<?php if(have_posts()) : while(have_posts()) : the_post(); ?>
		<?php $categories = get_the_category(get_the_ID()); ?>
		<?php $comments = get_comments_number(get_the_ID()) > 1 ? get_comments_number(get_the_ID())." comments" : get_comments_number(get_the_ID())." comment"; ?>
			<?php if($this->CategoryModel->isCategoryReview(get_the_ID())) : ?>
			<div id="newItem-<?php echo get_the_ID(); ?>" class="lastItems review">
				<div class="reviewInfo floatLeft">
					<h1><?php the_title(); ?></h1>
					<?php if(has_post_thumbnail(get_the_ID())) : ?>
							<?php $thumb = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()),'full'); ?>
							<img src="<?php echo CORE_TIMTHUMB_URL.$thumb[0]."&w=215";?>" alt="<?php the_title(); ?>">
					<?php else : ?>
						<?php $thumbMeta = get_post_meta(get_the_ID(), 'thumbnail', true); ?>
						<?php if(!empty($thumbMeta)) : ?>
							<img src="<?php echo CORE_TIMTHUMB_URL.get_post_meta(get_the_ID(), 'thumbnail', true)."&w=215";?>" alt="<?php the_title(); ?>">
						<?php else : ?>
						<img src="<?php echo CORE_TIMTHUMB_URL.CORE_THEME_IMAGE."no-image.jpg&w=215&h=150";?>" alt="<?php the_title(); ?>">
						<?php endif; ?>
					<?php endif; ?>
					<p><?php  echo limitWord(get_the_content(),150); ?> <a href="<?php the_permalink(); ?>">Xem thêm</a></p>
				</div>
				<!-- /.reviewInfo -->
				<?php 
					$hostingReviews = get_post_meta(get_the_ID(),'review-hosting',true);
					$hostingReviews = explode(";",$hostingReviews);
					$review_support = get_post_meta(get_the_ID(),'review-support',true);
					$review_properties = get_post_meta(get_the_ID(),'review-properties',true);
					$review_download = get_post_meta(get_the_ID(),'review-download',true);
					$review_upload = get_post_meta(get_the_ID(),'review-upload',true);
					$review_desert = get_post_meta(get_the_ID(),'review-desert',true);
				?>
				<div class="reviewFeatured floatLeft">
					<?php if(count($hostingReviews)>1) : ?>
					<h4>Tính năng</h4>
					<ul>
						<?php foreach($hostingReviews as $key=>$review) : ?>
							<?php if(!empty($review)) : ?>
								<li><?php echo $review; ?></li>
							<?php endif; ?>
						<?php endforeach; ?>
					</ul>
					<?php else : ?>
					<h4>Không có tính năng</h4>
					<?php endif; ?>
				</div>
				<!-- /.reviewFeatured -->
				<div class="reviewRate floatRight">
					<?php if(!empty($review_support) && !empty($review_desert)) : ?>
					<h4>Đánh giá</h4>
					<ul>
						<li>
							<span>Hỗ trợ KH</span>
							<div class="rating">
								<progress value="<?php echo (int)$review_support; ?>" max="100"></progress>
								<span class="reviewStatus">Tồi</span>
							</div>
						</li>
						<li>
							<span>Tính năng</span>
							<div class="rating">
								<progress value="<?php echo (int)$review_properties; ?>" max="100"></progress>
								<span class="reviewStatus">Đầy đủ</span>									
							</div>
						</li>
						<li>
							<span>Download</span>
							<div class="rating">
								<progress value="<?php echo (int)$review_download; ?>" max="100"></progress>
								<span class="reviewStatus">Nhanh</span>
							</div>
						</li>
						<li>
							<span>Upload</span>
							<div class="rating">
								<progress value="<?php echo (int)$review_upload; ?>" max="100"></progress>
								<span class="reviewStatus">Chậm</span>
							</div>
						</li>
						<li>
							<span>Giá trị</span>
							<div class="rating">
								<progress value="<?php echo (int)$review_desert; ?>" max="100"></progress>
								<span class="reviewStatus">Tuyệt vời</span>
							</div>
						</li>
					</ul>
					<?php else : ?>
					<h4>Chưa được đánh giá</h4>
					<?php endif; ?>
					<div class="viewMoreReview"><a href="<?php the_permalink(); ?>">Gửi đánh giá của bạn</a></div>
				</div>
				<!-- /.reviewRate -->
				<div class="clearfix"></div>
			</div>
			<!-- /.lastItems -->
			<?php else : ?>
			<div id="newItem-<?php echo get_the_ID(); ?>" class="lastItems">
				<div class="postImg floatLeft">
					<a href="<?php the_permalink(); ?>">
						<?php if(has_post_thumbnail(get_the_ID())) : ?>
							<?php $thumb = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()),'full'); ?>
							<img src="<?php echo CORE_TIMTHUMB_URL.$thumb[0]."&w=215";?>" alt="<?php the_title(); ?>">
					<?php else : ?>
						<?php $thumbMeta = get_post_meta(get_the_ID(), 'thumbnail', true); ?>
						<?php if(!empty($thumbMeta)) : ?>
							<img src="<?php echo CORE_TIMTHUMB_URL.get_post_meta(get_the_ID(), 'thumbnail', true)."&w=215";?>" alt="<?php the_title(); ?>">
						<?php else : ?>
						<img src="<?php echo CORE_TIMTHUMB_URL.CORE_THEME_IMAGE."no-image.jpg&w=215&h=150";?>" alt="<?php the_title(); ?>">
						<?php endif; ?>
					<?php endif; ?>
					</a>
					<div class="tag">
						<?php foreach($categories as $category) : ?>
							<a href="<?php echo get_category_link($category->term_id); ?>">#<?php echo $category->name; ?></a>
						<?php endforeach; ?>
					</div>
					<!-- /.tag -->
				</div>
				<!-- /.postImg -->
				<div class="postDescription floatRight">
					<h1><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
					<ul>
						<li class="author"><a href="<?php echo get_author_posts_url(get_the_author_meta('ID')); ?>"><?php the_author(); ?></a></li>
						<li class="time"><?php the_date('d/m/Y'); ?></li>
						<li class="comments"><a href="<?php the_permalink(); ?>#disqus_thread"><?php echo $comments; ?></a></li>
					</ul>
					<p><?php the_excerpt(); ?></p>
				</div>
				<!-- /.postDescription -->
				<div class="clearfix"></div>
			</div>
			<!-- /.lastItems -->
			<?php endif; ?>

		<?php endwhile; endif; ?>
		<?php wp_reset_query(); ?>
		<?php wp_pagenavi(); ?>

	</section>

	<!-- /#lastestPost.floatLeft -->

	<?php $this->sidebar(); ?>

	<div class="clearfix"></div>
</article>
<!-- /#mainContent.wrapper -->
